<?php

namespace App\Models;

use App\Models\Business\DepartmentBasicQuote;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class QuotaionInformation extends Model
{
    use HasFactory;
    protected $guarded = [];
    protected function serializeDate(\DateTimeInterface $date)
    {
        return $date->format('Y/m/d H:i:s');
    }
    //价格区间
    public function priceRange(){
        return $this->hasMany(PriceRange::class,'group_id','group_id');
    }
    //顾客信息
    public function customer(){
        return $this->hasOne(CustomerManager::class,'id','customer_id');
    }
    //部门id
    public function department(){
        return $this->hasOne(Department::class,'id','department_id');
    }
    //店铺id
    public function shop(){
        return $this->hasMany(ShopDetail::class,'quotaion_information_id','id');
    }
    //服务部报价
    public function departmentQuote(){
        return $this->belongsTo(DepartmentBasicQuote::class,'department_quote_id');
    }


}
